<%@page import="com.billing.model.entity.TManagerPermissions"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
List<TManagerPermissions> mplist = (List<TManagerPermissions>)request.getSession().getAttribute("mplist");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
	
	<!-- start: Meta -->
	<meta charset="utf-8">
	<title>首页</title>
	<meta name="author" content="Dennis Ji">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link id="bootstrap-style" href="<c:url value="/css/bootstrap.min.css"/>" rel="stylesheet">
	<link href="<c:url value="/css/bootstrap-responsive.min.css"/>" rel="stylesheet">
	<link id="base-style" href="<c:url value="/css/style.css"/>" rel="stylesheet">
	<link id="base-style-responsive" href="<c:url value="/css/style-responsive.css"/>" rel="stylesheet">
	<link href="<c:url value="/css/index.css"/>" rel="stylesheet">
	<link rel="shortcut icon" href="<c:url value="/img/favicon.ico"/>">

</head>

<body>
		<!-- start: Header -->
		<!-- start: title-->
	<%@include file="title.jsp" %>
	<!-- start: Header -->
		<div id="basePath" value="<%=basePath%>" style="display:none;"></div>
		<div class="container-fluid-full">
		<div class="row-fluid" style="height: 100%">
			<!-- start: Main Menu -->
			<div id="sidebar-left" class="span2" style="overflow-y: auto">
				<div class="nav-collapse sidebar-nav">
					<ul class="nav nav-tabs nav-stacked main-menu" style="margin-top: 60px">
					<%  
						if(mplist!=null){
				            for(TManagerPermissions mp:mplist){  
				                  if(mp.getFatherId()==0){
                	%>  
						<li>
							<a class="dropmenu" href="#"><i class="nvaimg"><img src="<c:url value="<%=mp.getImg()%>"/>"></i><span class="hidden-tablet"><%=mp.getName()%> </span><span class="label label-important"></span></a>
							<ul>
								<%  
					            for(TManagerPermissions mp1:mplist){  
					                  if(mp.getId()==mp1.getFatherId()){
                				%>  
								<li><a class="submenu" id="test" href="#" onclick="updateIframe('<%=mp1.getUrl()%>')"><i class=""></i><span class="hidden-tablet"><%=mp1.getName()%></span></a></li>
								 <%  
						                  }
						            }  
						         %>  
							</ul>
						</li>
                	 <%  
				                  }
				            }  
						}
			         %>  
					</ul>
				</div>
			</div>
			<!-- end: Main Menu -->
			
			
			<!-- start: Content -->
			<div id="maincontent" style="height: 100%;margin-left: 14.422%">
				<iframe src="" scrolling="auto" id="mainFrame" name="mainFrame" frameborder="0" marginheight="0" marginwidth="0" height="100%" width="100%"></iframe>
			</div>
			
	
			<!-- end: Content -->
		</div><!--/#content.span10-->
		</div><!--/fluid-row-->
		
	<div class="modal hide fade" id="myModal">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal">×</button>
			<h3>Settings</h3>
		</div>
		<div class="modal-body">
			<p>Here settings can be configured...</p>
		</div>
		<div class="modal-footer">
			<a href="#" class="btn" data-dismiss="modal">Close</a>
			<a href="#" class="btn btn-primary">Save changes</a>
		</div>
	</div>
	
	<div class="clearfix"></div>
	
	<!-- start: footer  <%@include file="footer.jsp" %>	-->
	

	<!-- start: JavaScript-->
		<script src="<c:url value="/js/jquery-1.9.1.min.js"/>"></script>
		<script src="<c:url value="/js/jquery-migrate-1.0.0.min.js"/>"></script>
		<script src="<c:url value="/js/jquery-ui-1.10.0.custom.min.js"/>"></script>
		<script src="<c:url value="/js/jquery.ui.touch-punch.js"/>"></script>
		<script src="<c:url value="/js/modernizr.js"/>"></script>
		<script src="<c:url value="/js/bootstrap.min.js"/>"></script>
		<script src="<c:url value="/js/jquery.cookie.js"/>"></script>
		<script src="<c:url value="/js/fullcalendar.min.js"/>"></script>
		<script src="<c:url value="/js/jquery.dataTables.min.js"/>"></script>
		<script src="<c:url value="/js/excanvas.js"/>"></script>
		<script src="<c:url value="/js/jquery.flot.js"/>"></script>
		<script src="<c:url value="/js/jquery.flot.pie.js"/>"></script>
		<script src="<c:url value="/js/jquery.flot.stack.js"/>"></script>
		<script src="<c:url value="/js/jquery.flot.resize.min.js"/>"></script>
		<script src="<c:url value="/js/jquery.chosen.min.js"/>"></script>
		<script src="<c:url value="/js/jquery.uniform.min.js"/>"></script>
		<script src="<c:url value="/js/jquery.cleditor.min.js"/>"></script>
		<script src="<c:url value="/js/jquery.noty.js"/>"></script>
		<script src="<c:url value="/js/jquery.elfinder.min.js"/>"></script>
		<script src="<c:url value="/js/jquery.raty.min.js"/>"></script>
		<script src="<c:url value="/js/jquery.iphone.toggle.js"/>"></script>
		<script src="<c:url value="/js/jquery.uploadify-3.1.min.js"/>"></script>
		<script src="<c:url value="/js/jquery.gritter.min.js"/>"></script>
		<script src="<c:url value="/js/jquery.imagesloaded.js"/>"></script>
		<script src="<c:url value="/js/jquery.masonry.min.js"/>"></script>
		<script src="<c:url value="/js/jquery.knob.modified.js"/>"></script>
		<script src="<c:url value="/js/jquery.sparkline.min.js"/>"></script>
		<script src="<c:url value="/js/counter.js"/>"></script>
		<script src="<c:url value="/js/retina.js"/>"></script>
		<script src="<c:url value="/js/custom.js"/>"></script>
	<!-- end: JavaScript-->
		<script>
		$(function(){ 
			$("a.submenu").click(function() {
                $("a.submenu").removeClass("active");
                $(this).addClass("active");
            });
		});
		function updateIframe(type){
			var url=$("#basePath").attr("value")
			url +=type;
			$("#mainFrame").attr("src",url);
		}
		</script>
</body>
</html>
